package com.meitianhui.convenitenbuy.util;

import rx.Subscriber;

public abstract class RxBusSubscriber<T> extends Subscriber<T> {

    private static final String TAG = "RxBusSubscriber";
    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {
        LogUtils.d(TAG,"onError");
        e.printStackTrace();
    }

    @Override
    public void onNext(T t) {
        try{
            onEvent(t);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    protected abstract void onEvent(T t);
}
